// Gear.cs created with MonoDevelop
// User: juan at 05:56 26/02/2009
//
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
//

using System;
using System.Collections.Generic;
using System.IO;

using rWords= monook.Constants;

namespace monook
{
	
	
	public class Gear
	{
		private List<string> source;
		private string actualWord;
		
		public Gear()
		{
			this.source=new List<string>();
		}
		

		public void AddCharToActualWord(string c){
			this.actualWord +=c;
			print(this.actualWord);
		}
		
		public void EndActualWord(){
			source.Add(actualWord);
			actualWord="";
		}
		
		public void Save(string text, string filePath){
			StreamWriter writer = null;			
			try{			
				writer = new StreamWriter(filePath);
				writer.Write(text);
			}catch (Exception ex){
				throw ex;
			}finally{
				writer.Close();
			}
		}
		
		public string Read(string filePath){
			StreamReader reader=null;
			string read="";
			try{
				reader = new StreamReader(filePath);
				read=reader.ReadToEnd();
			}catch(Exception ex){
				throw ex;
			}finally{
				reader.Close();
			}
			return read;
		}
		
		void print(object msg){
			Console.WriteLine(msg);
		}
	}
}
